import { pubRequire } from '@utils/public'
const baseUrl = '/advertising-spaces'
// 获取列表
export function getList(obj, callBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callBack, errBack)
}
// 新增广告位
export function add(obj, callBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callBack, errBack)
}
// 编辑广告位
export function edit(id, obj, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}`, obj, callBack, errBack)
}
// 广告位详情
export function getDetail(id, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}`, '', callBack, errBack)
}
// 删除广告位
export function del(id, callBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${id}`, '', callBack, errBack)
}
// 关闭广告位
export function close(id, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}/close`, '', callBack, errBack)
}
// 启用广告位
export function open(id, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}/open`, '', callBack, errBack)
}
//推送
export function push(id, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}/push`, '', callBack, errBack)
}